Inclusivly enumerates from start key to the end of the collection
Syntax
Example
BPlusTree/BPlusTree.Test/BasicTests.cs
C# | Copy Code |
---|
using (BPlusTree<int, string> data = Create(Options))
{
for (int i = 0; i < 100; i++)
data.Add(i, i.ToString());
Assert.AreEqual(50, new List<KeyValuePair<int, string>>(data.EnumerateFrom(50)).Count);
Assert.AreEqual(25, new List<KeyValuePair<int, string>>(data.EnumerateFrom(75)).Count);
for (int i = 0; i < 100; i++)
{
int first = -1;
foreach (KeyValuePair<int, string> kv in data.EnumerateFrom(i))
{
first = kv.Key;
break;
}
Assert.AreEqual(i, first);
}
} |
VB.NET | Copy Code |
---|
Using data As BPlusTree(Of Integer, String) = Create(Options)
Dim i As Integer = 0
While i < 100
data.Add(i, i.ToString())
System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While
Assert.AreEqual(50, New List(Of KeyValuePair(Of Integer, String))(data.EnumerateFrom(50)).Count)
Assert.AreEqual(25, New List(Of KeyValuePair(Of Integer, String))(data.EnumerateFrom(75)).Count)
Dim i As Integer = 0
While i < 100
Dim first As Integer = -1
For Each kv As KeyValuePair(Of Integer, String) In data.EnumerateFrom(i)
first = kv.Key
Exit For
Next
Assert.AreEqual(i, first)
System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While
End Using |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also